<?php
namespace app\api\controller;

use app\BaseController;
use app\model\OnePage as SelfModel;

use think\facade\Cookie;
use think\Response;
use think\Request;
class OnePage extends Base
{


    public function initialize()
    {
        parent::initialize();
        $this->model = "\app\model\OnePage";
        $this->list_rows = 10;
        $this->msg = '单页';
        
        
    }


    public function json(Request $request)
    {
        $data = $this->model::where('id', $request->id)->value($request->value ?? 'content');
        $data = str_replace('src="', 'style="width:100%;"src="' . $request->domain(), $data);
        //$dataInfo['detail_html'] = str_replace('<img', '<img style="display:block;"', $dataInfo['detail_html']);
        return ['code'=>200,'msg'=>'msg','data'=>$data];
    }


}
